<template>
  <div class="mycell">
    <van-cell is-link center class="cell">
      <template #icon>
        <!-- icon字符串 因此要用v-html识别 -->
        <i class="iconfont f1" v-html="icon"> </i>
      </template>
      <template #title>
        <div class="title">{{ title }}</div>
      </template>
      <template #default>
        <img :src="baseUrl + right" alt="" v-if="type === 'img' && right" />
        <img
          src="@/assets/logo.png"
          alt=""
          v-else-if="type === 'img' && !right"
        />
        <div class="right-value" v-else>
          {{ right }}
        </div>
      </template>
      <template #right-icon>
        <i class="iconfont f2">&#xe653; </i>
      </template>
    </van-cell>
  </div>
</template>
<script>
export default {
  props: ['icon', 'title', 'right', 'type'],
  data () {
    return {
      baseUrl: process.env.VUE_APP_URL
    }
  }
}
</script>
<style lang="less" scoped>
.mycell {
  .cell {
    padding: 15px;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
    }
    .f1 {
      font-size: 20px;
      margin-right: 10px;
    }
    .title {
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #181a39;
      line-height: 20px;
      letter-spacing: 0px;
    }
    .right-value {
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: right;
      color: #5b5d75;
      line-height: 20px;
      letter-spacing: 0px;
    }
    .f2 {
      font-size: 14px;
      margin-left: 10px;
    }
  }
}
</style>
